package com.gudaichaoren.spider.pageprocesser;

import cn.hutool.core.util.StrUtil;
import com.gudaichaoren.spider.constant.Constants;
import com.gudaichaoren.spider.entity.LotteriesShuangseAnalysis;
import us.codecraft.webmagic.selector.Selectable;

public class LotteriesShuangseDataAnalysis implements LotteriesShuangseData {

    private LotteriesShuangseAnalysis lotteriesShuangseAnalysis;

    public LotteriesShuangseDataAnalysis(LotteriesShuangseAnalysis lotteriesShuangseAnalysis) {
        this.lotteriesShuangseAnalysis = lotteriesShuangseAnalysis;
    }

    /**
     * 号码:class:style
     *
     * @return
     */
    private int splicingAnalysisInfo(Selectable selectable) {
        //获取号码
        return Integer.parseInt(selectable.xpath("//td/text()").toString().trim());
    }

    @Override
    public void setFirst(Selectable selectable) {
        String s = selectable.xpath("//i/text()").toString();
        lotteriesShuangseAnalysis.setAnalysisType(Constants.LotteriesShuangseAnalysisTypeEnum.valueOf(s).getCode());
    }

    @Override
    public void setRedBall01(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall01(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall02(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall02(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall03(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall03(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall04(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall04(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall05(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall05(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall06(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall06(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall07(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall07(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall08(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall08(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall09(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall09(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall10(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall10(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall11(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall11(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall12(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall12(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall13(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall13(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall14(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall14(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall15(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall15(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall16(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall16(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall17(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall17(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall18(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall18(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall19(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall19(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall20(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall20(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall21(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall21(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall22(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall22(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall23(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall23(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall24(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall24(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall25(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall25(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall26(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall26(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall27(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall27(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall28(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall28(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall29(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall29(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall30(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall30(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall31(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall31(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall32(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall32(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setRedBall33(Selectable selectable) {
        lotteriesShuangseAnalysis.setRedBall33(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall01(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall01(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall02(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall02(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall03(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall03(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall04(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall04(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall05(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall05(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall06(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall06(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall07(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall07(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall08(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall08(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall09(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall09(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall10(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall10(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall11(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall11(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall12(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall12(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall13(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall13(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall14(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall14(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall15(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall15(splicingAnalysisInfo(selectable));
    }

    @Override
    public void setBlueBall16(Selectable selectable) {
        lotteriesShuangseAnalysis.setBlueBall16(splicingAnalysisInfo(selectable));
    }

    public LotteriesShuangseAnalysis getLotteriesShuangseAnalysis() {
        return lotteriesShuangseAnalysis;
    }
}
